package com.wuliu.intercepter;

import java.util.Map;

import com.wuliu.model.sys.User;
import com.wuliu.util.DbUtil;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class LoginValidate extends AbstractInterceptor {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public String intercept(ActionInvocation arg0) throws Exception {

		Map<String, Object> session = arg0.getInvocationContext().getSession();
        User vo = (User) session.get("user");

        String forward	= "";
        if(vo==null){
        	forward = "againIndex";
        }else{
            arg0.invoke();
        }

        return forward;
	}   

}
